﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Content.ascx.cs" Inherits="Content" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<table cellpadding="0" cellspacing="0" width="100%" class="admintable">
    <tr runat="server" visible="false">
        <td class="lable">
            Ngôn ngữ:
        </td>
        <td>
            <asp:DropDownList ID="cmbLanguage" runat="server" Width="112px" AutoPostBack="True"
                OnSelectedIndexChanged="cmbLanguage_SelectedIndexChanged">
                <asp:ListItem Text="Vietnamese" Selected="True" Value="vi-VN"></asp:ListItem>
                <asp:ListItem Value="en-US">English</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td class="lable">
            Mục tin:
        </td>
        <td>
            <asp:DropDownList ID="cmbMucTin" runat="server" Width="255px" 
                AutoPostBack="True" onselectedindexchanged="cmbMucTin_SelectedIndexChanged">
              
            </asp:DropDownList>
        </td>
    </tr>
    <tr runat="server">
        <td class="lable" >  
            Tiều đề: <span style="color: red"><strong>(*)</strong></span>
        </td>
        <td>
            <asp:TextBox ID="txtTitle" runat="server" Width="250px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitle"
                ErrorMessage="Nhập tiêu đề" SetFocusOnError="True" Width="87px"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="lable" valign="top">
            Nội dung: <span style="color: red"><strong>(*)</strong></span>
        </td>
        <td>
            <FCKeditorV2:FCKeditor ID="txtContent" runat="server" BasePath="~/fckeditor/" Height="650px"
                Width="100%">
            </FCKeditorV2:FCKeditor>
            <asp:CustomValidator runat="server" ErrorMessage="Nhập nội dung" ID="CustValDesc"
                ControlToValidate="txtContent" ClientValidationFunction="ValidateFCK" ValidateEmptyText="True"></asp:CustomValidator>
        </td>
    </tr>
</table>

<script language="javascript" type="text/javascript">
function ValidateFCK(source, args) {

var fckBody = FCKeditorAPI.GetInstance('<%=txtContent.ClientID %>');
args.IsValid = fckBody.GetXHTML(true) != "";
}
</script>

